package d1116.r214.num07;

import java.util.ArrayList;
import java.util.Iterator;

public class DemoArrayList02 {
    public static void main(String[] args) {
        ArrayList<String> arrayList=new ArrayList<String>();
        arrayList.add("刘备");
        arrayList.add("关羽");
        arrayList.add("张飞");
        arrayList.add("赵云");
        //迭代器遍历
        Iterator<String> it=arrayList.iterator();
        while(it.hasNext()){
            System.out.println(it.next());
        }

       /* System.out.println(it.next());
        System.out.println(it.next());
        System.out.println(it.next());
        System.out.println(it.next());

        */


    }
}
